<?php
$v_record_id = 0;
if(isset($_REQUEST['hdn_record_id'])){
	$v_record_id = intval($_REQUEST['hdn_record_id']);
}
//Luu trang ngay tiep nhan hien thoi
if(isset($_REQUEST['hdn_received_date_filter'])){
	$v_receive_date_filter = $_REQUEST['hdn_received_date_filter'];
} 
if(_is_sqlserver()){//CSDL MSSQL 
	// Lay noi dung cua mot ho so
	$sql = "Exec Onegate_CustomerRecordGetSingle " . $v_record_id ;
	//echo $sql;exit;
	$ado_conn->SetFetchMode(ADODB_FETCH_ASSOC);
	$arr_single_record = $ado_conn->GetRow($sql); 
}
if ($v_record_id == 0 || $v_record_id == ''){
	$v_list_xml_tag = "";
	if(isset($_REQUEST['hdn_list_xml_tag'])){
		$v_list_xml_tag = $_REQUEST['hdn_list_xml_tag'];
	}
	$v_list_xml_value = "";
	if(isset($_REQUEST['hdn_list_xml_value'])){
		$v_list_xml_value = $_REQUEST['hdn_list_xml_value'];
	}
	$strXML = '<?xml version="1.0" encoding="UTF-8"?><root><data_list>';
	for ($i=0;$i<_list_get_len($v_list_xml_tag,_CONST_SUB_LIST_DELIMITOR);$i++){
		$strXML = $strXML ."<"._list_get_at($v_list_xml_tag,$i,_CONST_SUB_LIST_DELIMITOR).">";
		$strXML = $strXML .trim(_replace_XML_bad_char(_list_get_at($v_list_xml_value,$i,_CONST_SUB_LIST_DELIMITOR)));
		$strXML = $strXML ."</"._list_get_at($v_list_xml_tag,$i,_CONST_SUB_LIST_DELIMITOR).">";
	}
	$strXML = $strXML . "</data_list></root>";
	$arr_single_record['C_RECEIVED_RECORD_XML_DATA'] = $strXML;
	$arr_single_record['C_RECEIVED_DATE'] = date("n/d/Y");
	//var_dump($arr_single_record);
	//echo htmlspecialchars($strXML);
	//echo $v_record_id."aaaaaaaaaaaaaaaaaaaaaaaaaa";exit;

}
?>